package com.luck.pf.util;

import com.luck.pf.common.entity.UserBean;
public class BaseQuery {
	/**
	 * 用户对象
	 */
	private UserBean userInfo;
	/**
	 * 页码
	 */
	private int pageNo = 1;
	/**
	 * 也大小
	 */
	private int pageSize = 20;
	/**
	 * 排序列
	 */
	private String orderByColumn;
	/**
	 * 排序类型  
	 * 0降序DESC  
	 * 1升序ASC
	 */
	private int orderByType;
	/**
	 * 正式提交查询
	 */
	int qryIt;
	String operateType;//操作类型
	Long orgId;//所属机构

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public String getOrderByColumn() {
		return orderByColumn;
	}

	public void setOrderByColumn(String orderByColumn) {
		this.orderByColumn = orderByColumn;
	}


	public int getOrderByType() {
		return orderByType;
	}

	public void setOrderByType(int orderByType) {
		this.orderByType = orderByType;
	}

	/**
	 * @return the userInfo
	 */
	public UserBean getUserInfo() {
		return userInfo;
	}

	/**
	 * @param userInfo
	 *            the userInfo to set
	 */
	public void setUserInfo(UserBean userInfo) {
		this.userInfo = userInfo;
	}

	/**
	 * 获取查询16进值
	 * 
	 * @return
	 */
	public String getQryHex() {
		try {
			this.userInfo = null;
			// 只序列化String long Date 类型
			byte b[] = ObjectUtil.getBytesFromObject(this);
			StringBuffer sb = new StringBuffer();
			sb = new StringBuffer();
			for (int i = 0; i < b.length; i++) {
				String s = Integer.toHexString(b[i]);
				if (s.length() < 2)
					sb.append("0");
				else if (s.length() > 2)
					s = s.substring(s.length() - 2);
				sb.append(s);
			}
			return sb.toString();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "";
	}

	public int getQryIt() {
		return qryIt;
	}

	public void setQryIt(int qryIt) {
		this.qryIt = qryIt;
	}
	public String getOperateType() {
		return operateType;
	}
	public void setOperateType(String operateType) {
		this.operateType = operateType;
	}

	public Long getOrgId() {
		return orgId;
	}

	public void setOrgId(Long orgId) {
		this.orgId = orgId;
	}

}
